﻿using System;
using System.Collections;
using System.IO;

#if UNITY_EDITOR
using UnityEngine;
#endif
namespace Battle.Engine
{
    public class Debug
    {


        public static void Log(object message)
        {
            //Console.ForegroundColor = ConsoleColor.White;
            //Console.WriteLine(message);
            message = "Engine:" + message;
#if UNITY_EDITOR && TEST
            UnityEngine.Debug.Log("<color=cyan>"+message+"</color>");
#else
            //if (message == null)
            //{
            //    System.Diagnostics.Debugger.Log(1, "log", "log " + "\r\n");
            //}
            //else
            //{
            //    System.Diagnostics.Debugger.Log(1, "log", "log " + message.ToString() + "\r\n");
            //}
#endif
        }

        public static void LogWarning(object message)
        {
            //Console.ForegroundColor = ConsoleColor.Yellow;
            //Console.WriteLine(message);
            message = "Engine:" + message;
#if UNITY_EDITOR
            //UnityEngine.Debug.LogWarning("<color=green>" + message + "</color>");
#else
            //if (message == null)
            //{
            //    System.Diagnostics.Debugger.Log(5, "warning", "warning\r\n ");
            //}
            //else
            //{
            //    System.Diagnostics.Debugger.Log(5, "warning", "warning: " + message.ToString() + "\r\n");
            //}
#endif
        }
        public static void LogWarningSpe(object message)
        {
            //Console.ForegroundColor = ConsoleColor.Yellow;
            //Console.WriteLine(message);
            message = "Engine:" + message;
#if UNITY_EDITOR
            UnityEngine.Debug.Log("<color=orange>" + message + "</color>");
#else 
            //if (message == null)
            //{
            //    System.Diagnostics.Debugger.Log(5, "warning", "warning\r\n ");
            //}
            //else
            //{
            //    System.Diagnostics.Debugger.Log(5, "warning", "warning: " + message.ToString() + "\r\n");
            //}
#endif
        }
        public static void LogFightMsg(object message)
        {
#if UNITY_EDITOR && TEST
            FileLog.Log(message.ToString());
            //UnityEngine.Debug.Log("<color=orange>" + message + "</color>");
#endif
        }
        public static void LogFightMsg100(object message)
        {
#if UNITY_EDITOR && TEST100
            FileLog.Log(message.ToString());
#endif
        }

        public static void LogError(object message)
        {
            //Console.ForegroundColor = ConsoleColor.Red;
            //Console.WriteLine(message);
            message = "Engine:" + message;
#if UNITY_EDITOR
            UnityEngine.Debug.LogError(message);
#else
            //if (message == null)
            //{
            //    System.Diagnostics.Debugger.Log(9, "error", "Error: " + "\r\n");
            //}
            //else
            //{
            //    System.Diagnostics.Debugger.Log(9, "error", "Error: " + message.ToString() + "\r\n");
            //}
#endif
        }

    }
}